#include "parser.h"
#include <string.h>
#include <stdlib.h>
#include <assert.h>


/*parsing command line for number of paremeters like in main function*/
/*return the number or command tockens*/
int parser( char* commandline, char* args[]){
  char  cmdline[512];
  char * token ;
  int argc = 0; 
  strcpy(cmdline,commandline);
  for(token= strtok(cmdline, " \n"),  argc = 0 ; token != 0; token = strtok(0, " \n"), argc++)
    {
      args[argc] = malloc(strlen(token));
      strcpy(args[argc], token);
    } 
  return argc - 1 ;
}


